package com.mall.shopping.converter;

import com.mall.shopping.dal.entitys.Item;
import com.mall.shopping.dto.TestItemDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * @Classname TestProductInfoConverter
 * @Description
 * @Date 2021/8/24 12:49
 * @Author terrance_swn
 */
@Mapper(componentModel = "spring")
public interface TestProductInfoConverter  {

    /**
     * item转化为itemDto
     * @param item
     * @return
     */
    @Mappings({
            @Mapping(source = "title",target = "productName"),
            @Mapping(source = "image",target = "img")
    })
    TestItemDto item2ItemDto(Item item);
}
